package com.szdvte.news.action.client;

import com.szdvte.news.bean.NewsCollect;
import com.szdvte.news.bean.Users;
import com.szdvte.news.service.IUserService;
import com.szdvte.news.util.WiterUtil;

public class UserClientAction 
{
	private IUserService userService;
	private Users user;
	private NewsCollect collect;
	//注册
	public void register()
	{
		user.setUserPhoto("images/user_photo.png");
		WiterUtil.response(userService.add(user));
	}
	//登录
	public void login()
	{
		user.setUserFlag(1);
		user = userService.login(user);
		WiterUtil.witer(user,"user");
	}
	
	//收藏
	public void collect()
	{
		WiterUtil.response(userService.collect(collect)+"");
	}
	public NewsCollect getCollect() 
	{
		return collect;
	}
	public void setCollect(NewsCollect collect) 
	{
		this.collect = collect;
	}
	public IUserService getUserService() 
	{
		return userService;
	}
	public void setUserService(IUserService userService) 
	{
		this.userService = userService;
	}
	public Users getUser() 
	{
		return user;
	}
	public void setUser(Users user) 
	{
		this.user = user;
	}
}
